function cellInfo = Environment_Info_Bus(varargin) 
% ENVIRONMENT_INFO_BUS returns a cell array containing bus object information 
% 
% Optional Input: 'false' will suppress a call to Simulink.Bus.cellToObject 
%                 when the MATLAB file is executed. 
% The order of bus element attributes is as follows:
%   ElementName, Dimensions, DataType, SampleTime, Complexity, SamplingMode, DimensionsMode, Min, Max, DocUnits, Description 

suppressObject = false; 
if nargin == 1 && islogical(varargin{1}) && varargin{1} == false 
    suppressObject = true; 
elseif nargin > 1 
    error('Invalid input argument(s) encountered'); 
end 

cellInfo = { ... 
  { ... 
    'Environment_Info_Bus', ... 
    '', ... 
    sprintf('Collision Information'), ... 
    'Auto', ... 
    '-1', {... 
{'timestamp', 1, 'uint32', -1, 'real', 'Sample', 'Fixed', [], [], sprintf('ms'), ''}; ...
{'hit_point', 3, 'single', -1, 'real', 'Sample', 'Fixed', [], [], sprintf('m'), sprintf('Hit point in NED frame')}; ...
{'hit_normal', 3, 'single', -1, 'real', 'Sample', 'Fixed', [], [], '', sprintf('Hit point normal')}; ...
{'hit_location', 3, 'single', -1, 'real', 'Sample', 'Fixed', [], [], sprintf('m'), sprintf('Hit location in NED frame')}; ...
{'torque', 3, 'single', -1, 'real', 'Sample', 'Fixed', [], [], sprintf('N*m'), sprintf('External torque applied at body in body frame')}; ...
{'force', 3, 'single', -1, 'real', 'Sample', 'Fixed', [], [], sprintf('N'), sprintf('External force applied at body in body frame.')}; ...
    } ...
  } ...
}'; 

if ~suppressObject 
    % Create bus objects in the MATLAB base workspace 
    Simulink.Bus.cellToObject(cellInfo) 
end 
